package cn.hznc.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @Author：Administrator
 * @Date：2023/8/25 15:58
 */
@Getter
@Setter
@Table(name = "t_machine_tool_data_log")
@TableName(value = "t_machine_tool_data_log")
public class MachineToolDataLog{

    /**
     * 主键
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;


    /**
     * 机床id
     */
    @Column(name = "warehouse_id",type = MySqlTypeConstant.INT,length = 11)
    @TableField("warehouse_id")
    private Integer warehouseId;

    /**
     * 机床名
     */
    @Column(name = "warehouse_name",type = MySqlTypeConstant.VARCHAR,length = 150)
    @TableField("warehouse_name")
    private String warehouseName;

    /**
     * 长度
     */
    @Column(name = "length",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("length")
    private String length;

    /**
     * 额定寿命
     */
    @Column(name = "tool_life",type = MySqlTypeConstant.DOUBLE,length = 14)
    @TableField("tool_life")
    private Double toolLife;

    /**
     * 刀号
     */
    @Column(name = "tool_no",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("tool_no")
    private String toolNo;


    /**
     * 额定寿命
     */
    @Column(name = "tool_radius",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("tool_radius")
    private String toolRadius;


    /**
     * 使用寿命
     */
    @Column(name = "tool_usage_time",type = MySqlTypeConstant.DOUBLE,length = 14)
    @TableField("tool_usage_time")
    private Double toolUsageTime;

    /**
     * 唯一标识
     */
    @Column(name = "unique_id",type = MySqlTypeConstant.VARCHAR,length = 150)
    @TableField("unique_id")
    private String uniqueId;

    /**
     * 程序
     */
    @Column(name = "program",type = MySqlTypeConstant.VARCHAR,length = 200)
    @TableField("program")
    private String program;

    /**
     * 程序
     */
    @Column(name = "time",type = MySqlTypeConstant.DOUBLE,length = 14)
    @TableField("time")
    private Double time =0.0;

    /**
     * 工单号
     */
    @Column(name = "task_id",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("task_id")
    private String taskId;

    /**
     * 开始时间
     */
    @Column(name = "start_time",type = MySqlTypeConstant.DATETIME)
    @TableField("start_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 结束时间
     */
    @Column(name = "end_time",type = MySqlTypeConstant.DATETIME)
    @TableField("end_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 工序号
     */
    @Column(name = "seq",type = MySqlTypeConstant.INT , length = 5)
    @TableField("seq")
    private Integer seq;

    /**
     * 工序名称
     */
    @Column(name = "craft_name",type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField("craft_name")
    private String craftName;

    /**
     * 工序名称
     */
    @Column(name = "machine_tool_task_id",type = MySqlTypeConstant.INT , length = 11)
    @TableField("machine_tool_task_id")
    private Integer machineToolTaskId;

    /**
     * 刀具执行此任务的耗时
     */
    @TableField(exist = false)
    private Double groupTime;

    @Column(name = "position",type = MySqlTypeConstant.VARCHAR , length = 20)
    @TableField("position")
    private String position;

    @Column(name = "rfid",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("rfid")
    private String rfid;

    /**
     * 结束时间
     */
    @Column(name = "create_time",type = MySqlTypeConstant.DATETIME)
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 结束时间
     */
    @Column(name = "flag",type = MySqlTypeConstant.TINYINT)
    @TableField("flag")
    private Integer flag;

    /**
     * 进给速度
     */
    @Column(name = "feed_speed",type = MySqlTypeConstant.VARCHAR , length = 40)
    @TableField("feed_speed")
    private String feedSpeed;

    /**
     * 进给率
     */
    @Column(name = "feed_override",type = MySqlTypeConstant.VARCHAR , length = 40)
    @TableField("feed_override")
    private String feedOverride;

    /**
     * 总成零件参数
     */
    @Column(name = "tool_params",type = MySqlTypeConstant.VARCHAR , length = 40)
    @TableField("tool_params")
    private String toolParams;

    /**
     * 使用寿命
     */
    @TableField(exist = false)
    private Double sumTime;
}
